<!--#index.html-->
<!--head-->
<script>
    $(function() {
        $("#form").ajaxFormEx(function(data) {
            if(data.msg) {
                $("#form .alert").text(data.msg).fadeOut().fadeIn();
            } else {
                window.location.href = "topic.html?id=${topic.id}"
            }
        })
        $("div.shafa").each(function(i) {
            i = i + ${replies.offset};
            if(i==0) i = "沙发";
            else if(i==1) i = "椅子";
            else if(i==2) i = "板凳";
            else i = (i+1) + "楼"
            $(this).text(i)
        })
    })
</script>
<title>${topic.title} - wBBS</title>
<!--head end-->
<!--content-->
<style>
    p.pre {
        white-space: pre-line;
    }
    div.author {
        text-align: center;
    }
    div.shafa {
        font-size: 24px;
        padding-top: 30px;
        text-align: center;
    }
</style>
<h3>${topic.title}</h3>
<hr/>
<div class="row">
    <div class="span2">
        <div class="author">
            <img src="${author.head}"/><br/>
            <a href="">${topic.authorId}(${author.name})</a><br/>
            <span>${topic.postDate.toLocaleString()}</span>
        </div>
    </div>
    <div class="span10">
        <p class="pre">${topic.content}</p>
    </div>
</div>
<div class="row" w:r="replies">
    <div class="span1 shafa"></div>
    <div class="span9">
        <p class="pre">${r.content}</p>
    </div>
    <div class="span2">
        <div class="author">
            <img src="${r.author.head}"/><br/>
            <a href="">${r.authorId}(${r.author.name})</a><br/>
            <span>${r.postDate.toLocaleString()}</span>
        </div>
    </div>
</div>
<div class="pagination">
    <ul>
        <li class="${replies.page>1?'active':null}"><a href="topic.html?id=${topic.id}&pg=${replies.page-1}" title="上一页">«</a></li>
        <li w:pg="replies.pgs" class="${pg.current?'active':null}"><a href="topic.html?id=${topic.id}&pg=${pg.page}">${pg.label}</a></li>
        <li class="${replies.page<replies.pageCount?'active':null}"><a href="topic.html?id=${topic.id}&pg=${replies.page+1}" title="下一页">»</a></li>
    </ul>
</div>
<form action="topic.reply" method="post" id="form" class="form-horizontal">
    <input type="hidden" name="topicId" value="${topic.id}"/>
    <div class="alert alert-error hide"></div>
    <textarea rows="10" cols="50" name="content" class="input-xxlarge" placeholder="正文" style="margin-bottom: 10px"></textarea>
    <br/>
    <button type="submit" class="btn btn-primary">快速回复</button>
</form>
<!--content end-->
<!--#index.html end-->